package com.ala4.oxcafe.repository.mapper;

import com.ala4.oxcafe.entity.RoleInfo;
import com.ala4.oxcafe.entity.UserInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 用户信息
 *
 * @author PING
 * @version 1.0.0
 * @date 2025/8/12 12:44
 */
public interface UserInfoMapper extends BaseMapper<UserInfo> {

    @Select("select DISTINCT t.* from role_info t " +
            "left join user_role_rel r on t.id = r.role_id " +
            "where r.user_id = #{userId}")
    List<RoleInfo> selectUserRole(@Param("userId") Long id);
}
